﻿<%@ Page Language="C#" MasterPageFile="~/INFTUR.master" AutoEventWireup="true" CodeBehind="ManterUsuario.aspx.cs" Inherits="INFTUR.ManterUsuario" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="principal" style="width:400px">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        
        <div id="consulta" style="width:400px">
        
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataSourceID="odsUsuario">
                <Columns>
                    <asp:BoundField DataField="Login" HeaderText="Login" SortExpression="Login" />
                    <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                    <asp:BoundField DataField="Tipo" HeaderText="Tipo" SortExpression="Tipo" />
                    <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                    <asp:TemplateField HeaderText="Atualizar">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbAtualizar" runat="server" onclick="btAtualizar_Click">Atualizar</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Remover">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbRemover" runat="server" onclick="lbRemover_Click">Remover</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="odsUsuario" runat="server" 
                DataObjectTypeName="Negocios.UsuarioBO" DeleteMethod="Remove" 
                InsertMethod="inserir" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="ConsultaTodos" TypeName="Negocios.UsuarioBOMetodos" 
                UpdateMethod="Atualiza">
                <DeleteParameters>
                    <asp:Parameter Name="login" Type="String" />
                </DeleteParameters>
            </asp:ObjectDataSource>
        
        </div>
        
        <div id="cadastro" class="divDados" style="width:400px">
        
            <table>
                <tr>
                    <td>
                        Id</td>
                    <td class="style1">
                        <asp:TextBox ID="tbID" runat="server"></asp:TextBox>
&nbsp;
                        <asp:Button ID="btNovo" runat="server" style="text-align: center" 
                            Text="Novo Usuário" Width="138px" onclick="btNovo_Click" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Nome</td>
                    <td class="style1">
                        <asp:TextBox ID="tbNome" runat="server" Width="320px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Tipo</td>
                    <td class="style1">
                        <asp:DropDownList ID="ddlTipo" runat="server">
                            <asp:ListItem Value="0">Selecione o tipo</asp:ListItem>
                            <asp:ListItem Value="1">Administrador</asp:ListItem>
                            <asp:ListItem Value="2">Agente</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        E-mail</td>
                    <td class="style1">
                        <asp:TextBox ID="tbEmail" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Senha</td>
                    <td class="style1">
                        <asp:TextBox ID="tbSenha" runat="server" TextMode="Password"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        &nbsp;<asp:Button ID="btSalvar" runat="server" onclick="btSalvar_Click" 
                            Text="Salvar" />
&nbsp;
                        <asp:Button ID="btCancelar" runat="server" Text="Cancelar" 
                            onclick="btCancelar_Click" />
                    </td>
                </tr>
            </table>
        
            <br />
            <asp:Label ID="lbErro" runat="server" CssClass="erro"></asp:Label>
        
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">

    <style type="text/css">
        .style1
        {
            width: 324px;
        }
    </style>

</asp:Content>
